<!DOCTYPE html>
<?php 
/*
$link = mysql_connect('hostname','dbuser','dbpassword'); 
if (!$link) { 
	die('Could not connect to MySQL: ' . mysql_error()); 
} 
echo 'Connection OK'; 
mysql_close($link);
*/ 
?> 

<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
#nav-menu ul
{
list-style: none;
padding: 0;
margin: 0;
}

#nav-menu li
{
float: left;
margin: 0 0.15em;
}

#nav-menu li a
{
background: url(../../Users/Sarath/Desktop/background.gif) #fff bottom left repeat-x;
height: 2em;
line-height: 2em;
float: left;
width: 9em;
display: block;
border: 0.1em solid #dcdce9;
color: #0d2474;
text-decoration: none;
text-align: center;
}

  html { height: 100% }
  body { height: 100%; margin: 0; padding: 0 }
  #map_canvas { height: 100% }
.logo {
	font-family: "Comic Sans MS", cursive;
	font-size: 36px;
}
</style>
<script type="text/javascript">
</script>
</head>
<body>

<table border=0 align="center">

  
<tr>
  <td height="76" colspan="2"><img src="sun.jpg" width="400" height="150" alt="image"><span class="logo">Automated Weather Station</span><br>
  <div id="nav-menu">
<ul>
<li><a href="test.php">Home</a></li>
<li><a href="weather.php">Weather Details</a></li>
<li><a href="aboutus.php">eResearch</li>

</ul>
</div>

</td></tr>
<tr>
  <td height="77" colspan="2">

  </td>
</tr>
  <tr>
    <td width="576">
<?php
$connection = mysql_connect('localhost', 'admin', 'admin');
mysql_query('USE aws;');
$query = "SELECT * FROM weatherstation, weatherdetails WHERE weatherstation.aws_id = weatherdetails.aws_id";
$result = mysql_query($query);
Print "<table border=1 align = 'center'>";
Print "<tr>";
Print "<th>AWS Name</th><th>Temperature: </th><th> Rainfall</th><th> Humidity</th><th> Pressure</th><th> Wind Direction</th><th>Wind Gust</th><th> Dew Point</th><th> AWS ID</th>";
Print "</tr>";
while($info = mysql_fetch_array($result))
{
Print "<tr>";
Print "<td>".$info['aws_name']."</td>";
Print "<td>".$info['Temperature']."</td>";
Print "<td>".$info['Rainfall']."</td>";
Print "<td>".$info['Humidity']."</td>";
Print "<td>".$info['Pressure']."</td>";
Print "<td>".$info['WindDirection']."</td>";
Print "<td>".$info['WindGust']."</td>";
Print "<td>".$info['DewPoint']."</td>";
Print "<td>".$info['aws_id']."</td></tr>";
}





Print "</table>";
?>

</td></tr>

</table>


<?php
mysql_close($connection);
?>




</body>
</html>